package com.nbsaas.boot.scm.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "采购申请单明细", model = "采购申请单明细")
@Entity
@Table(name = "bs_purchase_requisition_item")
@Comment("采购申请单明细表")
public class PurchaseRequisitionItem extends AbstractEntity {

    @Comment("采购申请单ID")
    @FormField(title = "采购申请单ID", sortNum = "1", grid = true, required = true)
    private Long purchaseRequisitionId;

    @Comment("采购申请单编号")
    @FormField(title = "采购申请单编号", sortNum = "2", grid = true, required = true)
    @Column(length = 50, nullable = false)
    private String purchaseRequisitionNo;

    @Comment("商品ID")
    @FormField(title = "商品", sortNum = "3", grid = true, type = InputType.select, required = true)
    private Long productId;

    @Comment("商品SKU ID")
    @FormField(title = "商品SKU", sortNum = "4", grid = true, type = InputType.select)
    private Long productSkuId;

    @Comment("商品编码")
    @FormField(title = "商品编码", sortNum = "5", grid = true)
    @Column(length = 100)
    private String productCode;

    @Comment("商品名称")
    @FormField(title = "商品名称", sortNum = "6", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String productName;

    @Comment("商品规格")
    @FormField(title = "商品规格", sortNum = "7", grid = true)
    @Column(length = 200)
    private String productSpecification;

    @Comment("商品单位")
    @FormField(title = "商品单位", sortNum = "8", grid = true)
    @Column(length = 20)
    private String productUnit;

    @Comment("申请数量")
    @FormField(title = "申请数量", sortNum = "9", grid = true, type = InputType.el_input_number, required = true)
    private Integer requisitionQuantity;

    @Comment("预计单价")
    @FormField(title = "预计单价", sortNum = "10", grid = true, type = InputType.el_input_number)
    @Column(precision = 10, scale = 2)
    private BigDecimal estimatedUnitPrice;

    @Comment("预计总金额")
    @FormField(title = "预计总金额", sortNum = "11", grid = true, type = InputType.el_input_number, sort = true)
    @Column(precision = 15, scale = 2)
    private BigDecimal estimatedTotalAmount;

    @Comment("预算金额")
    @FormField(title = "预算金额", sortNum = "12", grid = true, type = InputType.el_input_number)
    @Column(precision = 15, scale = 2)
    private BigDecimal budgetAmount;

    @Comment("技术要求")
    @FormField(title = "技术要求", sortNum = "13", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String technicalRequirements;

    @Comment("质量要求")
    @FormField(title = "质量要求", sortNum = "14", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String qualityRequirements;

    @Comment("交货要求")
    @FormField(title = "交货要求", sortNum = "15", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String deliveryRequirements;

    @Comment("推荐供应商")
    @FormField(title = "推荐供应商", sortNum = "16", grid = true)
    @Column(length = 200)
    private String recommendedSupplier;

    @Comment("预计需求日期")
    @FormField(title = "预计需求日期", sortNum = "17", type = InputType.date, grid = true)
    private Date expectedNeedDate;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "18", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String remark;
} 